public class ExpressionFactory {
    public Expression createExpression(String type, int operand1, int operand2) {
        if (type == null) {
            throw new IllegalArgumentException("Invalid expression type");
        }

        if (type.equalsIgnoreCase("addition")) {
            return new AdditionExpression(operand1, operand2);
        } else if (type.equalsIgnoreCase("subtraction")) {
            return new SubtractionExpression(operand1, operand2);
        } else {
            throw new IllegalArgumentException("Invalid expression type");
        }
    }
}